package com.uzai.common.enums;

/**
 * 钉钉群消息报警
 * @Auther: liuqi
 * @Date: 2023/03/14 16:45
 * @Webhookription:
 */
public enum DindDingGroupMsgEnum {
    GOODS_ERROR("SEC92a42cc0b9074a03428128f61e1f66534f096cca0ada9b134b1e03fad68b4282","https://oapi.dingtalk.com/robot/send?access_token=36f4a08cbfef38cab961db80dd17e34b8beb59655186f7df5421cfe6eb81d5f2", "cidYGKNBOz9Hb1k/Z8/Ng0zbQ==", "商品异常提醒客服群", "转链失败，请检查商品是否已下架。\n商品idB段：%s"),
    INVOICE_CHECK("SEC5c4f8ef3c2c36bfbeaae06e8d31614d8573764a338b4489fd8db9a74b683f224","https://oapi.dingtalk.com/robot/send?access_token=ed435494addccbb5f4c03b7d37af6ae7088b7783c76e12c5fc4e687d483a2051", "cidwGSLC9f0XrVmsErH9Yrz+w==", "发票审核", "有新的发票需要审核！"),
    GOODS_NOT_ENOUGH("SEC5ed52badda9a6f6bc41e05e93686b0a894787a1283d66016650a1c7572f6a4ff","https://oapi.dingtalk.com/robot/send?access_token=82e587b9ff9d1a9b0edca0d2e658896ed8b259f7929144ef5735d2bd93eb7d85", "cidYGKNBOz9Hb1k/Z8/Ng0zbQ==", "精品库商品不够发送朋友圈提醒群", "自动发朋友圈功能，未找到新的悠哉精品库商品!\n运营商账号：%s"),
    ;

    private String secret;
    private String webhook;
    private String openConversationId;
    private String desc;
    private String msg;

    DindDingGroupMsgEnum(String secret, String webhook, String openConversationId, String desc, String msg) {
        this.secret = secret;
        this.webhook = webhook;
        this.openConversationId = openConversationId;
        this.desc = desc;
        this.msg = msg;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getWebhook() {
        return webhook;
    }

    public void setWebhook(String webhook) {
        this.webhook = webhook;
    }

    public String getOpenConversationId() {
        return openConversationId;
    }

    public void setOpenConversationId(String openConversationId) {
        this.openConversationId = openConversationId;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static DindDingGroupMsgEnum getBySecret(String secret) {
        if (secret == null) {
            return null;
        }
        for (DindDingGroupMsgEnum demo: DindDingGroupMsgEnum.values()) {
            if (demo.getSecret().equals(secret)) {
                return demo;
            }
        }
        return null;
    }
}
